using System;
using System.Collections.Generic;
using System.Text;
using LibrErian.Common;
using LibrErian.Model;
using System.Windows.Forms;
using Microsoft.Practices.CompositeUI.WinForms;
using LibrErian.Common.Constants;

namespace LibrErian.Modules.BasicBook
{
    public class SelectAuthorController : WorkItemController
    {
        public Author Run()
        {
            SelectAuthorView view = WorkItem.SmartParts.AddNew<SelectAuthorView>();

            WindowSmartPartInfo info = new WindowSmartPartInfo();
            info.Title = "Select Author";
            info.Modal = true;

            WorkItem.Workspaces[WorkspaceNames.WindowWorkspace].Show(view, info);

            return view.SelectedAuthor;
        }
    }
}
